/**
 * @(#) AppmssProxy.as
 *
 * @date		2011. 03. 25
 * @version		1.0
 * @author		baek kwang hyoun
 * @description	평가결과 Proxy - Proxy
 */
package com.skt.common_hr.empcontop.model
{
	import com.skt.common_hr.common.Variables;
	import com.skt.common_hr.common.puremvc.CommonProxy;
	import com.skt.common_hr.empcontop.model.vo.mainListVO;
	import com.wcl.dataloader.*;
	
	import mx.controls.Alert;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;

	public class CompanyProxy extends CommonProxy
	{
		public static const NAME:String = "CompanyProxy";




		/**
		 * 생성자
		 *
		 * @param
		 * @return void
		 */
		public function CompanyProxy(data:Object=null)
		{
			super(NAME, data);
		}

		public function saveSend(vo:mainListVO, setFunc:Function):void
		{
			var tables:Object = new Object();
			var obj:Object = {};
			obj.I_PERNR = Variables.myPernr;
			obj.I_ECODE = vo.ECODE;
			obj.I_BEGDA =  vo.BEGDA;
			obj.I_ENDDA =  vo.ENDDA;


			var table:Array = new Array();			
			var obj2:Object = {};
			obj2.CYES = "X";
			table.push(obj2);
			
			tables["ITAB"] = table;

			saveData("Z_HR_EC03", obj, tables, saveResult, saveFault, setFunc);
		}

		public function saveResult(event:ResultEvent):void
		{
			if(retCode==0) {
				event.result.func();
			}
			else {
				Alert.show(retText);
			}
		}
		
		private function saveFault(event:FaultEvent):void
		{
			Alert.show('HthIcProxy.as listFault err: ' + retText);
		}
		
		public function savePrint(vo:mainListVO, setFunc:Function):void
		{
			var tables:Object = new Object();
			var obj:Object = {};
			obj.I_PERNR = Variables.myPernr;
			obj.I_ECODE = vo.ECODE;
			obj.I_BEGDA =  vo.BEGDA;
			obj.I_ENDDA =  vo.ENDDA;
			
			var table:Array = new Array();   
			var obj2:Object = {};
			obj2.CYES = "X";
			obj2.PYES = "X";
			table.push(obj2);
			   
			tables["ITAB"] = table;
			saveData("Z_HR_EC03", obj, tables, savePrintResult, saveFault, setFunc);
		}

		public function savePrintResult(event:ResultEvent):void
		{
			if(retCode==0) {
				event.result.func();
			}
			else {
				Alert.show(retText);
			}
		}
	
	}		
}